//
//  UIImage+extention.swift
//  Swift微博
//
//  Created by 在下叶良辰 on 16/6/4.
//  Copyright © 2016年 谢浩源. All rights reserved.
//

import UIKit

extension UIImage {
    class func createAdotImage () ->UIImage {
        
//        let frame = CGSize(width: 300, height: 300)
        let size = CGSizeMake(1, 1)
        //1. 创建图形上下文
        UIGraphicsBeginImageContextWithOptions(size, true, UIScreen.mainScreen().scale)
        
        //2. 设置线的颜色
        let color = UIColor(white: 0.9, alpha: 1.0)
        color.set()
        
        //3. 设置区域填充
        UIRectFill(CGRect(x: 0, y: 0, width: size.width, height: size.height))
        
        //4. 获取图片
        let image = UIGraphicsGetImageFromCurrentImageContext()
        
        //5. 关闭上下文
        UIGraphicsEndImageContext()
        
        //6. 返回image
        return image
    }
}
